package com.ship.dispatch.controller.orderPay;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.google.gson.Gson;
import com.ship.dispatch.bean.orderPay.SpPaymentOrder;
import com.ship.dispatch.bean.orderPay.SpPaymentOrderDetail;
import com.ship.dispatch.service.orderPay.SpPaymentOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <b>TestFundManageController</b>
 *
 * @description: TestFundManageController <br>
 * @date: 2024/8/20 16:53 <br>
 * @author: lhm <br>
 * @version: 1.0 <br>
 */

@RestController
@Api(tags = "测试资金管理")
public class TestFundManageController {
    @Autowired
    private SpPaymentOrderService spPaymentOrderService;


    @ApiOperation("测试资金管理")
    @PostMapping("/test/fund")
    public void testFundManage(@RequestParam String paymentOrder, @RequestParam String spPaymentOrderDetail){
        SpPaymentOrder spPaymentOrder = JSONUtil.toBean(paymentOrder, SpPaymentOrder.class);
        SpPaymentOrderDetail spPaymentOrderDetail1 = JSONUtil.toBean(spPaymentOrderDetail, SpPaymentOrderDetail.class);
        spPaymentOrderService.synchronousSpFundManage(spPaymentOrder,spPaymentOrderDetail1);
    }
}
